package filter;

import utils.EncodingWrapper;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
@WebFilter(urlPatterns = {"/*"})
public class ECode implements Filter {
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        HttpServletRequest request = (HttpServletRequest) servletRequest;
        EncodingWrapper encodingWrapper = new EncodingWrapper(request, "UTF-8");
        filterChain.doFilter(encodingWrapper,servletResponse);
    }
}
